﻿@model shradhabookstores.Admin

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Admin</h4>
        <hr />
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.ID)

        <div class="form-group">
            @Html.LabelFor(model => model.UserName, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.UserName)
                @Html.ValidationMessageFor(model => model.UserName)
            </div>
        </div>
        @if(Convert.ToInt32(Session["ID"])==Model.ID)
        {
             <div class="form-group">
            @Html.LabelFor(model => model.Password, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Password)
                @Html.ValidationMessageFor(model => model.Password)
            </div>
        </div>
        }
        @if (Convert.ToInt32(Session["Level"]) == 1)
        { 
        <div class="form-group">
            @Html.LabelFor(model => model.Level_, "Level_", new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("Level_", String.Empty)
                @Html.ValidationMessageFor(model => model.Level_)
            </div>
        </div>

        }
        
        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" class="btn btn-default" />
            </div>
        </div>
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
